import { LAYOUT,newLAOUT,FORMITEM,newFORMITEM,FIELD,newFIELD } from '../attr-widget'

export interface DATEPICKER extends LAYOUT,FORMITEM,FIELD {
  picker: 'date' | 'week' | 'month' | 'quarter' | 'year' | 'time'
  format: 'YYYY-MM-DD' | 'YYYY-ww' | 'YYYY-MM' | 'YYYY-Q' | 'YYYY' | 'YYYY-MM-DD HH:mm:ss'
}

export function newDATEPICKER(attr?:DATEPICKER):DATEPICKER{
  return Object.assign(
    newLAOUT(),
    newFORMITEM(),
    newFIELD(),
    {
      picker: 'date',
      format: 'YYYY-MM-DD'
    },
    attr
  ) as DATEPICKER
}

export const STATUS_OPTIONS = [
  {value:'0',label:'隐藏'},
  {value:'1',label:'占位'},
  {value:'2',label:'只读'},
  {value:'3',label:'编辑'},
  {value:'4',label:'必填'}
]